<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hfun.server.dao${writePackageName}.W${objectName}Mapper">
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from ${tableTop}${tableName}
    where id = ${r"#{"}id${r"}"}
  </delete>
  <insert id="insert" parameterType="com.hfun.server.domain${packageName}.${objectName}Model">
    insert into ${tableTop}${tableName} (
      <#list columns as item>
      ${item.column}<#if item_has_next>,</#if>
      </#list>
    )
    values (
      <#list columns as item>
      ${r"#{"}${item.property}${r"}"}<#if item_has_next>,</#if>
      </#list>
    )
  </insert>
  <insert id="insertSelective" parameterType="com.hfun.server.domain${packageName}.${objectName}Model">
    insert into ${tableTop}${tableName}
    <trim prefix="(" suffix=")" suffixOverrides=",">
  <#list columns as item>
      <if test="${item.property} != null">
        ${item.column}<#if item_has_next>,</#if>
      </if>
  </#list>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
  <#list columns as item>
      <if test="${item.property} != null">
        ${r"#{"}${item.property}${r"}"}<#if item_has_next>,</#if>
      </if>
  </#list>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.hfun.server.domain${packageName}.${objectName}Model">
    update ${tableTop}${tableName}
    <set>
  <#list columns as item>
      <if test="${item.property} != null">
        ${item.column} = ${r"#{"}${item.property}${r"}"}<#if item_has_next>,</#if>
      </if>
  </#list>
    </set>
    where id = ${r"#{"}id${r"}"}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.hfun.server.domain${packageName}.${objectName}Model">
    update ${tableTop}${tableName}
    set
  <#list columns as item>
      ${item.column} = ${r"#{"}${item.property}${r"}"}<#if item_has_next>,</#if>
  </#list>
    where id = ${r"#{"}id${r"}"}
  </update>
</mapper>